home *** CD-ROM | disk | FTP | other *** search
/ Almathera Ten Pack 3: CDPD 3 / Almathera Ten on Ten - Disc 3: CDPD3.iso / scope / 126-150 / scopedisk129 / viewall / view_all < prev    next >
Text File  |  1995-03-19  |  3KB  |  65 lines

  1. /*    View (REXX) - Uses FReq as a picture Viewing program.           */
  2. /*    Written By:  Jeff Wahaus   -  This program is Public Domain     */
  3.  
  4. /*   Uses the Show, SHAMView, HAMGif, Dyna-Show, and MacView programs to
  5.    view IFF, SHAM, GIF, Dynamic Hi-Res, and Macintosh picture files.
  6.  
  7.      Note that this program assumes that the above programs are located
  8.    in your C: directory.  Change the PATH varible to have it look some
  9.    where else.
  10.  
  11.      Also, this program determines picture type by the filename's extension.
  12.    you need to name your picture files in a consistant manor.
  13.    
  14.      Note that:        .pic .hm .ham .iff  =  IFF picture File
  15.                                     .sham  =  Sliced HAM picture
  16.                                 .dyn .dhs  =  Dynamic Hi-Res picture
  17.                                      .gif  =  GIF picture File
  18.                                      .mac  =  Macintosh picture file
  19. */
  20.  
  21. PATH = "C:"     /* Change this to point to your Viewing programs */
  22.         /* ** NOTE ** PATH must end with ':' or '/'      */
  23.  
  24. if ~(Show('P', 'FileRequester')) then    /* Looking for FReq */
  25.     do
  26.     ADDRESS COMMAND "C:Run <NIL: >NIL: DEVS:Freq <NIL: >NIL:"
  27.     ADDRESS COMMAND "C:WaitForPort FileRequester"
  28.     if ~(Show('P', 'FileRequester')) then
  29.         exit
  30.     end
  31.  
  32. OPTIONS RESULTS
  33. ADDRESS "FileRequester"    /* the following commands go to FReq */
  34. 'SetFileName'        /* clear the file name */
  35. 'SetPattern'        /* clear the pattern */
  36. more = "TRUE"
  37. do while more = "TRUE"
  38.     'SetTitle View_All - Select a Picture to View'
  39.     'DisplayDef'    /* display default settings */
  40.     'GETFILENAME'
  41.     if (RC = 0) then
  42.         do
  43.         filename = Result
  44.         extension = right(filename, 4)
  45.         extension = upper(extension)
  46.         if ((extension = ".PIC") | (right(extension, 3) = ".HM") | (extension = ".HAM") | (extension = ".IFF")) then
  47.             ADDRESS COMMAND PATH || "Show" '"' || filename || '"'
  48.         else if (extension = "SHAM") then
  49.             ADDRESS COMMAND PATH || "ShamView" '"' || filename || '"'
  50.         else if ((extension = ".DYN") | (extension = ".DHS")) then
  51.             ADDRESS COMMAND PATH || "Dyna-Show" filename
  52.             /* Dyna-Show dosn't like quotes around a filename */
  53.         else if (extension = ".GIF") then
  54.             ADDRESS COMMAND PATH || "HAMGIF" '"' || filename || '"'
  55.         else if (extension = ".MAC") then
  56.             ADDRESS COMMAND PATH || "MacView -b -f -h" filename
  57.             /* MacView dosn't like quotes around a filename */
  58.         else    /* try to show it anyway */
  59.             ADDRESS COMMAND PATH || "Show" '"' || filename || '"'
  60.         end
  61.     else
  62.         more = "FALSE"    /* User hit CANCEL or Close Window */
  63.     end /* while */
  64. exit
  65.